﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IterationLife.Domains.Sports.Models;

namespace IterationLife.Domains.Sports.Dtos.ZeppSports
{
    public class ZeppTeam
    {
        public string id { get; set; }
        public string name { get; set; }
        public string avatar { get; set; }
        public int membersCount { get; set; }
    }


    public static class ZeppTeamExtension
    {
        public static SportTeam ToSportTeam(this ZeppTeam zeppTeam)
        {
            var result = new SportTeam(Guid.NewGuid());
            SetEntity(result, zeppTeam);
            return result;
        }

        public static void SetEntity(SportTeam sportTeam, ZeppTeam zeppTeam)
        {
            sportTeam.Logo = zeppTeam.avatar;
            sportTeam.PartnerTeamId = zeppTeam.id;
            sportTeam.Name = zeppTeam.name;
            sportTeam.PersonCount = zeppTeam.membersCount;
        }
    }
}